# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libu2f-host
pkgver=1.1.10
pkgrel=2
pkgdesc="Yubico Universal 2nd Factor (U2F) Host C Library"
url="https://developers.yubico.com/libu2f-host/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="hidapi-dev json-c-dev linux-headers eudev-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://developers.yubico.com/libu2f-host/Releases/libu2f-host-$pkgver.tar.xz
	json-c-0.14.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static \
		--with-udevrulesdir=/usr/lib/udev/rules.d
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="91c5bf3994f1d3c9bd144f54b14b0404d839c15bef3c318619decdf1bd37214bcff33927af78a9826ff7d0bc9907c912a0e31104ae68d3a727a8436f2a1dbf7a  libu2f-host-1.1.10.tar.xz
5221305e8474303a9b7db88b1a906d3d596251da412fc1b19cd6e9d8ec0ecbb8d93f91d3437c73c6b4226c4b7f0e80d4e37456d742e54ac5324bb0d36619ea67  json-c-0.14.patch"
